Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Add StartupWMClass to .desktop for easier window-app association #16791

Merged
merged 1 commit into from Feb 27, 2018
Merged

Add StartupWMClass to .desktop for easier window-app association #16791

merged 1 commit into from Feb 27, 2018

Conversation

Evpok
Copy link
Contributor

@Evpok Evpok commented Feb 20, 2018

Description of the Change

Just adds a StartupWMClass entry to atom.desktop. This helps window managers associating Atom's window with the .desktop file that started Atom. It should help with some issues relative atom in docks, such as missing or duplicated icons.

References

@iolsen
Copy link
Contributor

iolsen commented Feb 27, 2018

🎉 thanks for the contribution!

@iolsen iolsen merged commit 5fdfd65 into atom:master Feb 27, 2018
@Evpok Evpok deleted the startupwmclass-desktop branch February 28, 2018 19:08
@shadow-light
Copy link
Contributor

Did this work for anyone? I had to make "Atom" lowercase for it to work for me. Prior to that my atom windows would have no icon if launched from a terminal etc.

I'm happy to submit a new pull request to change this, as long as it won't stop it working for other users. I'm on Ubuntu 16.04

@Evpok
Copy link
Contributor Author

Evpok commented Sep 28, 2018

@shadow-light Both cases work for me, which they should, since xprop gives WM_CLASS(STRING) = "atom", "Atom" for atom windows. Can you check what it gives for you ?

@shadow-light
Copy link
Contributor

Hi @Evpok, yes that's the same for me, but one of those is the class name and one is the class. I recently discovered this via xdotool. For example, with Firefox:

~ xprop | grep WM_CLASS
WM_CLASS(STRING) = "Navigator", "Firefox"
~ xdotool search --onlyvisible --class "Navigator"
~ xdotool search --onlyvisible --classname "Navigator"
62914577
~ xdotool search --onlyvisible --class "Firefox"
62914577
~ xdotool search --onlyvisible --classname "Firefox"
~ 

So it would seem that application icons are matched via the classname rather than the class. Note, you can't actually test this out with xdotool for Atom as it does a case-insensitive search.

I double checked and atom definitely needs to be lowercase for my system to match it. If both work on yours, then perhaps it would be safe to switch it to lowercase then?

@Evpok
Copy link
Contributor Author

Evpok commented Sep 29, 2018

Sure, if it fixes the issue on your side, open a PR, by all means :-)

shadow-light added a commit to shadow-light/atom that referenced this pull request Sep 29, 2018
For some linux systems the window manager does not associate atom.desktop with Atom processes unless the class name is in lowercase. See atom#16791
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants